package gopsutil

import (
	"fmt"
	"github.com/shirou/gopsutil/disk"
	"github.com/shirou/gopsutil/mem"
)

func GetDiskAvailableSpace() {
	v, _ := disk.Usage("/") // 使用根目录获取磁盘使用情况
	fmt.Printf("Disk space available: %v GB\n", v.Free/1024/1024/1024)
}

func GetMemTotalSpace() {
	v, err := mem.VirtualMemory()
	if err != nil {
		fmt.Printf("Error getting virtual memory info: %s", err)
		return
	}
	fmt.Printf("Total: %v GB, Available: %v GB, Used: %v GB, UsedPercent: %f%%\n",
		v.Total/1024/1024/1024, v.Available/1024/1024/1024, v.Used/1024/1024/1024, v.UsedPercent)
}
